package com.yc.cinema.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.yc.cinema.bean.FilmInfo;
import com.yc.cinema.dao.IBaseDao;
import com.yc.cinema.dao.impl.BaseDaoImpl;
import com.yc.cinema.service.IFilmInfoService;
import com.yc.cinema.util.StringUtil;

public class FilmInfoServiceImpl implements IFilmInfoService{

	@Override
	public int update(FilmInfo fi) {
		if(StringUtil.checkNull(fi.getTid(), fi.getFname(), fi.getActor(), fi.getDirector(), fi.getTprice())) {
			return -1;
		}
		IBaseDao baseDao = new BaseDaoImpl();
		return baseDao.update("FilmInfoMapper.add", fi);
	}

	@Override
	public List<FilmInfo> findAll(FilmInfo fi) {
		IBaseDao baseDao = new BaseDaoImpl();
		return baseDao.list("FilmInfoMapper.findAll", fi);
	}
	
}
